# -*- coding: utf-8 -*-
# @Time    : 2021/8/31 0:06
# @Author  : BrandonGT
# @FileName: 05_PyQt5_QAbstractButton_简单介绍.py

# 1. 导入包和模块
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
import sys

# 2. 创建一个应用程序对象
app = QApplication(sys.argv)

# 3. 创建控件
window = QWidget()

# 3.1 设置控件
window.setWindowTitle("QAbstractButton")
window.resize(500, 500)


class Btn(QAbstractButton):
    def paintEvent(self, QPaintEvent):
        print("窗口被绘制了")


btn = Btn(window)

# 3.2 展示控件
window.show()

# 4. 应用程序执行，进入消息循环
sys.exit(app.exec_())